package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.SysUserMenu;
import com.ruoyi.system.mapper.SysUserMenuMapper;
import com.ruoyi.system.service.ISysUserMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户菜单关系Service业务层处理
 * 
 * @author WJH
 * @date 2022-08-02
 */
@Service
public class SysUserMenuServiceImpl extends ServiceImpl<SysUserMenuMapper, SysUserMenu>  implements ISysUserMenuService
{
    @Autowired
    private SysUserMenuMapper sysUserMenuMapper;

    /**
     * 查询用户菜单关系
     * 
     * @param userId 用户菜单关系主键
     * @return 用户菜单关系
     */
    @Override
    public SysUserMenu selectSysUserMenuByUserId(Long userId)
    {
        return sysUserMenuMapper.selectSysUserMenuByUserId(userId);
    }

    /**
     * 查询用户菜单关系列表
     * 
     * @param sysUserMenu 用户菜单关系
     * @return 用户菜单关系
     */
    @Override
    public List<SysUserMenu> selectSysUserMenuList(SysUserMenu sysUserMenu)
    {
        return sysUserMenuMapper.selectSysUserMenuList(sysUserMenu);
    }

    /**
     * 新增用户菜单关系
     * 
     * @param sysUserMenu 用户菜单关系
     * @return 结果
     */
    @Override
    public int insertSysUserMenu(SysUserMenu sysUserMenu)
    {
        return sysUserMenuMapper.insertSysUserMenu(sysUserMenu);
    }

    /**
     * 修改用户菜单关系
     * 
     * @param sysUserMenu 用户菜单关系
     * @return 结果
     */
    @Override
    public int updateSysUserMenu(SysUserMenu sysUserMenu)
    {
        return sysUserMenuMapper.updateSysUserMenu(sysUserMenu);
    }

    /**
     * 批量删除用户菜单关系
     * 
     * @param userIds 需要删除的用户菜单关系主键
     * @return 结果
     */
    @Override
    public int deleteSysUserMenuByUserIds(Long[] userIds)
    {
        return sysUserMenuMapper.deleteSysUserMenuByUserIds(userIds);
    }

    /**
     * 删除用户菜单关系信息
     * 
     * @param userId 用户菜单关系主键
     * @return 结果
     */
    @Override
    public int deleteSysUserMenuByUserId(Long userId)
    {
        return sysUserMenuMapper.deleteSysUserMenuByUserId(userId);
    }
}
